package com.numbfish.ch01_ex01_bean_resister.config;


import com.numbfish.ch01_ex01_bean_resister.Ch01Ex01BeanResisterApp;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import com.numbfish.ch01_ex01_bean_resister.pojo.Person;
import org.springframework.context.annotation.FilterType;
import org.springframework.stereotype.Controller;

//@Controller @Service @Repository @Component包自动扫描
// Filter[] excludeFilters() default {}; Filter 数组,Filter是注解
@ComponentScan(basePackages={"com.numbfish.ch01_ex01_bean_resister"},excludeFilters = {
        // 默认type为注解类型排除
        @ComponentScan.Filter(classes = {Controller.class}),
        // 指定排除的类，使用的类型为FilterType.ASSIGNABLE_TYPE
        @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,classes = Ch01Ex01BeanResisterApp.class)
})
@Configuration
public class CustomConfig01Base {
    @Bean("person1")
    public Person person(){
        return new Person("曹操",44);
    }
}
